
package database;

//import java.sql.PreparedStatement;
//import java.sql.ResultSet;
//import java.util.ArrayList;
import user.UserAccount;

import java.io.IOException;
import java.io.PrintWriter;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.util.ArrayList;

import java.sql.*;
import java.util.*;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;





public class Registration extends Database {
   public Registration() {}

   public void registrate(String lastName, String firstName, String emailAddr, String passWord)
   {
	   
	   UserAccount userAccount = new UserAccount(lastName, firstName, emailAddr, passWord); 
	   
	   try
	   {
		   PreparedStatement statement = connection.prepareStatement(
				   "INSERT INTO `ualbanybook`.`useraccount` (lastName, firstName, Email, password)"
	               + " VALUES (?,?,?,?);");
	       statement.setString(1, userAccount.getLastName());
	       statement.setString(2, userAccount.getFirstName());
	       statement.setString(3, userAccount.getEmailAddr());
	       statement.setString(4, userAccount.getPassWord());
	       statement.executeUpdate();
	   }
	   catch (Exception e) { e.printStackTrace(); }

   }
}

	